UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WoMMJnhThjCJ2zOjpA3T3ONODJ/dumHsAsW439H6W3s='
WHERE
key_id = '612988960811ede5275da10facfa850d9262026acc6bbd4d852402d636f1f57c'
AND (
token = 'WoMMJnhThjCJ2zOjpA3T3ONODJ/dumHsAsW439H6W3s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)