UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nxOtSRKjUuKBtA6g0Cf9pqzVnORjtrqLn4seEl032Sk='
WHERE
key_id = 'fbf24004b4bc9b672e927d6e072a821d493df090d0ab0be12f5d0665e59ac1c7'
AND (
token = 'nxOtSRKjUuKBtA6g0Cf9pqzVnORjtrqLn4seEl032Sk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)