UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LM2q9/i3H4z5e1le1swIknfO5w5mfqdaqA1BYmwve24=' 
WHERE 
  key_id = 'b8696597d0b5f34ec83be796e790d6eb90a6f7ac60e8c5901922bc3ca0044fcb' 
  AND (
    token = 'LM2q9/i3H4z5e1le1swIknfO5w5mfqdaqA1BYmwve24=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051