UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GfV/frkGOU/1SJ+fDIQuIuXY+TM8FyuYBxvF3b8rggs='
WHERE
key_id = 'c1bca531376fa82cc31ca0cf385ecc31d5b0a2604b0c4d19caed1dc5d8fec94c'
AND (
token = 'GfV/frkGOU/1SJ+fDIQuIuXY+TM8FyuYBxvF3b8rggs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)