UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uSuwDCcvn8twT6ut/+Ajv8Z5efb5lMBRMg7c4jT4MqM=' 
WHERE 
  key_id = 'da08448a365f7cad22948f1db20ea753ad8f76c313299af968da655b3a84da78' 
  AND (
    token = 'uSuwDCcvn8twT6ut/+Ajv8Z5efb5lMBRMg7c4jT4MqM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025