UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1/vWRApOQRTbS5xqLETjE1Iyjs26X8DRJfxo4wV+OuM='
WHERE
key_id = '3eb8c30569af39097fc15547b9d2985da804c8bba366424f8b4a71ac7b9134b4'
AND (
token = '1/vWRApOQRTbS5xqLETjE1Iyjs26X8DRJfxo4wV+OuM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)