UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wlr8zzJMCuboPPtDPL9bmTfFWrbsXZwdYtteq2WWaJ4=' 
WHERE 
  key_id = 'e5d12e48fd91a67f1516efdda136d06e6a5854f3eedc5eb2dd85283cb20f354c' 
  AND (
    token = 'wlr8zzJMCuboPPtDPL9bmTfFWrbsXZwdYtteq2WWaJ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029