UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UyMmIOeXpxMkzBgtM/F/utYRG6Wpdl7W+ND7QGiU8Tg='
WHERE
key_id = '5a0aeee49f1e0c3054e4315bb57f586811b4f36a5b075418efce85f03cf72dbd'
AND (
token = 'UyMmIOeXpxMkzBgtM/F/utYRG6Wpdl7W+ND7QGiU8Tg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)