UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WM+xdkcz3h+pQeBnoVvN2/2pFNrjlY5a6x1fhYVQAtw='
WHERE
key_id = '71b40aef39818e7c7ba572305cabe719f471fda67cfc3ad77931ab39b228b8ea'
AND (
token = 'WM+xdkcz3h+pQeBnoVvN2/2pFNrjlY5a6x1fhYVQAtw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)