UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xi9UP+SaLogr/5KqA7LM2RgGUuf9EBWt2FS8UeNNrHY=' 
WHERE 
  key_id = 'c0ad61b253ba74bbbfdc13e2250ca15eb7f9f9a5cd8d9c4b37770097482e18ea' 
  AND (
    token = 'xi9UP+SaLogr/5KqA7LM2RgGUuf9EBWt2FS8UeNNrHY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033