UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0e6OkqhgztFIwHj/h0VgDh5OqS2HTMT1xp6oRb/9e3E=' 
WHERE 
  key_id = '5064a59f118c00b5abeab52aff279dad309224adb5bfe525e9b5bbbd9f90bb92' 
  AND (
    token = '0e6OkqhgztFIwHj/h0VgDh5OqS2HTMT1xp6oRb/9e3E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061