UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kiCSrFKGz1LiWLgQ/6hyUibDqfVsdSg7kSOy7sC6gnU=' 
WHERE 
  key_id = '95bb80b589f365b4cfecb10e8701c0392ffcb776fe19d6849d7509be89026893' 
  AND (
    token = 'kiCSrFKGz1LiWLgQ/6hyUibDqfVsdSg7kSOy7sC6gnU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034