UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZuFy2nOh/MZtloDMzyusDR6/WwaNlxRoFunmHFCZ5cs=' 
WHERE 
  key_id = '0a5f5d5abd937cfcd75c853abca026b6859ffe35a6e21079d68fbb6436cfad98' 
  AND (
    token = 'ZuFy2nOh/MZtloDMzyusDR6/WwaNlxRoFunmHFCZ5cs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023