UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dkq07Ct67BYOdq5nGhHx0aKk7HP1rgPPlZq8WvVkkrc='
WHERE
key_id = '8c6efefaa628cc342cc187ee57b8c2eefa0d2ae1e35104b9553d2b7aea9669ba'
AND (
token = 'dkq07Ct67BYOdq5nGhHx0aKk7HP1rgPPlZq8WvVkkrc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)