UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WYaSJf1PRUPr0JAhw9/FsK9ApIWYgdFDIf5Gjq6i7Vk=' 
WHERE 
  key_id = 'e5b201fac6a7980ad8e15942cfac5fb751794f5d689ae6a0b1ccdd29e4afd4da' 
  AND (
    token = 'WYaSJf1PRUPr0JAhw9/FsK9ApIWYgdFDIf5Gjq6i7Vk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033