UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pAbNhROGUmURtFoiE9yqcG8xYwhMbzhd2Kvg8eLssWI='
WHERE
key_id = '38ba06810933e2c0949a1187cf8a2ceaddc997882e2e98a9c8cdf46f9f812cf8'
AND (
token = 'pAbNhROGUmURtFoiE9yqcG8xYwhMbzhd2Kvg8eLssWI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)