UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/yDvYzRUEbCvQWYS8mBeKP2CMS1FyGmyZtnzk0DLRPE='
WHERE
key_id = '2e805a40889f1481c4993ef373e9f8577315636a9c1db90f0de05d7f0cfa1c0c'
AND (
token = '/yDvYzRUEbCvQWYS8mBeKP2CMS1FyGmyZtnzk0DLRPE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)