UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GwvkDG4zQEuav5BbfAx7CBXBIXa09rFvXZQe6odChDo='
WHERE
key_id = '10703967d8e574e50d5e0e436e5e316c680ac3ad6eb81394419fe120296ad56e'
AND (
token = 'GwvkDG4zQEuav5BbfAx7CBXBIXa09rFvXZQe6odChDo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)