UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i7U+KEfio/Jbge/BFCD40N+Q/ojceKYn/53YS5d58TY='
WHERE
key_id = 'acd77ff64d0d75d461d87b5eaf635e3e186aa02a90e9e55559fd86cbf5e045d7'
AND (
token = 'i7U+KEfio/Jbge/BFCD40N+Q/ojceKYn/53YS5d58TY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)