UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hFoeZE5Bsw5Gab+zLrFw7Ts2de5sNKYPIif/Asp9Aj4='
WHERE
key_id = '77a01b98522d0aaee561d2506e9f53007c053c26b573ba2b79ce821e63a3af27'
AND (
token = 'hFoeZE5Bsw5Gab+zLrFw7Ts2de5sNKYPIif/Asp9Aj4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)