UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2webYYT7o9x8h3rAGK6LZQ3OPRMjyB4JM0joKAPXcwI='
WHERE
key_id = 'eec7cb959ad66685ac16dcd5c65636365acb838e19816043f2e6433b62a6901c'
AND (
token = '2webYYT7o9x8h3rAGK6LZQ3OPRMjyB4JM0joKAPXcwI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)