UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GyIPm2wK0DoV/G8cWgWvURxcfbA/w3jcRvXIvWzCEy8='
WHERE
key_id = '8ecd0d642fc7f735d5d6505a77c30fb2e1a9bb45e7d9fd327eaecc0f5be9b986'
AND (
token = 'GyIPm2wK0DoV/G8cWgWvURxcfbA/w3jcRvXIvWzCEy8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)