UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WtVSJcLIVF3l4S6Ri39o0UCOIjZZeowgoBJE3qLK8zg='
WHERE
key_id = '99954fafa0faf54e173b0f7da4646883496072192c9b624c10e3a5fd6c2a658c'
AND (
token = 'WtVSJcLIVF3l4S6Ri39o0UCOIjZZeowgoBJE3qLK8zg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)