UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VbMjcX2yZnCvgXkzZZcLny8etnxnY65SJ7MgfO2nGQg='
WHERE
key_id = 'cf81cf60439f43e5a117e8c2e922e081c1d863f20b4861c64b8514116b4c50d7'
AND (
token = 'VbMjcX2yZnCvgXkzZZcLny8etnxnY65SJ7MgfO2nGQg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)