UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wIVCHBx3385+qblgasNi5trlQXxjZ+jqPGeBwU677qU='
WHERE
key_id = '22a428b52365bcd543aa2c599ba83a5d715971c5aad0341de1eeb73bc353d082'
AND (
token = 'wIVCHBx3385+qblgasNi5trlQXxjZ+jqPGeBwU677qU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)