UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JoYjZyqS3IsOIQmvU739XYPKkU3mF2wnT/lKdQhR5DE='
WHERE
key_id = 'ea61840e1eb010cc96aa6eb10acd569904906ba06449590ae0c3a075b074e86e'
AND (
token = 'JoYjZyqS3IsOIQmvU739XYPKkU3mF2wnT/lKdQhR5DE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)