UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fnesJzUhNATP0vhx9u1hQWd8Gl/Q0JWSRdOp6CG183s='
WHERE
key_id = 'd53e0a3901b4bf94192f2d7991b1091f617c7f86ada768e604ecc80503fba224'
AND (
token = 'fnesJzUhNATP0vhx9u1hQWd8Gl/Q0JWSRdOp6CG183s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)