UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1AljytYhUuYy7TUQGgS1Ux5dIiBiaDigu/4LTDsNoeY='
WHERE
key_id = '8315bb470cf440901cd7c15300b6ef4ce1b1d5fef402688cf91d5a55ffa51b87'
AND (
token = '1AljytYhUuYy7TUQGgS1Ux5dIiBiaDigu/4LTDsNoeY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)