UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'diZ+/oLMZIFFRSBB6OCP7RV1xnR2lhuNEV+amnuh1l8='
WHERE
key_id = '363f24c089f8ed10a07545c5e8d4aa650d733a42dfe4105c233a911ac4f7087c'
AND (
token = 'diZ+/oLMZIFFRSBB6OCP7RV1xnR2lhuNEV+amnuh1l8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)