UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+GBihTjFIIAElz7iPUQYiTPfbRy7Ipp3yLOlrN+5YSI=' 
WHERE 
  key_id = '34a2ad8f46e9fb8100c6169c25a7e93d4edbb6134df12ba4321484d7cb653819' 
  AND (
    token = '+GBihTjFIIAElz7iPUQYiTPfbRy7Ipp3yLOlrN+5YSI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00084