UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mHMrFIXdoyZvVxy1fEDu7Hopqx4oD9a1UySyM7M4Kzg='
WHERE
key_id = '566028d23038e9b26bfd292f0416ccb4be16f870b09f49db1c725d979725dbb8'
AND (
token = 'mHMrFIXdoyZvVxy1fEDu7Hopqx4oD9a1UySyM7M4Kzg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)