UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mY+cyIqRkmfcUdPE7FIpL7ALft6krBYkg8n4CPLRqKw=' 
WHERE 
  key_id = '4c56124d80ebda3449218a787ac619ccdf4f65c10588d9d0d01937b3a3cecdc1' 
  AND (
    token = 'mY+cyIqRkmfcUdPE7FIpL7ALft6krBYkg8n4CPLRqKw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00075