UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lW5M6uieZZMW8bRG7a95mM3lI/gpWIAeCW7wZHwJKoE=' 
WHERE 
  key_id = '5d70a8f486ac993e71bec252651d158a79566cccd42fe3e11f086b8e939ea1e1' 
  AND (
    token = 'lW5M6uieZZMW8bRG7a95mM3lI/gpWIAeCW7wZHwJKoE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027