UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lvI1MQqRMDV7NHdXIYDoK7ExfdqPoIe0cW65qJPFbx4='
WHERE
key_id = 'f48545a8370778deb538b9dd0edfecedfa4c271cb62089d4d2ae5d9d20295b2e'
AND (
token = 'lvI1MQqRMDV7NHdXIYDoK7ExfdqPoIe0cW65qJPFbx4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)