UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xCCg59APqJsX0Cj8YZQTnIdUVOZtg/KwW/h9BAV7ppQ='
WHERE
key_id = '95db280b97d71cb559c9f2b0546f4293385984166d6c179deec3fe0b5bf064b0'
AND (
token = 'xCCg59APqJsX0Cj8YZQTnIdUVOZtg/KwW/h9BAV7ppQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)