UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5xDDtxIbM60TB+Wn8DPcMIifvQJUgZ7pPBTkQtWjD6Q='
WHERE
key_id = '06a901170748d8e1e8aa700b34bd4f85585c01adaf057fa4f465bc3b0612f7ea'
AND (
token = '5xDDtxIbM60TB+Wn8DPcMIifvQJUgZ7pPBTkQtWjD6Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)